package designpattern.command.keyboard;

import java.util.ArrayList;
import java.util.List;

public class KeyBoardService {
    private final List<IKeyBoardCommand> commands = new ArrayList<>();

    public void addCommand(IKeyBoardCommand keyBoardCommand){
        commands.add(keyBoardCommand);
    }

    public void executeCommand(){
        commands.forEach(IKeyBoardCommand::execute);
        commands.clear();
    }
}
